package com.xhwl.centiotdata.action.visitor;

import com.xhwl.common.dto.cent.visitor.VisitorAuthDTO;
import com.xhwl.common.dto.cent.visitor.VisitorGroupListDTO;
import com.xhwl.common.dto.cent.visitor.VisitorInfoDTO;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.common.pojo.cent.visitor.Auth;
import com.xhwl.common.query.cent.visitor.VisitorQRCodeQuery;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: yanyixiong
 * @Description:
 * @Date: create in 18:27 2022/3/3
 */
@RestController
public interface IVisitorAuth {

    /**
     * 访客授权操作
     * @param visitorAuthDTO
     * @return
     */
    @PostMapping(value = "/visitor-auth/create")
    ResultJson createVisitorAuth(@RequestPart("visitorAuthDTO") VisitorAuthDTO visitorAuthDTO );

    /**
     * 获取访客信息,根据预约码
     * @param visitorAuthDTO
     * @return
     */
    @PostMapping(value = "/visitor-auth/visitor-info-by-code")
    VisitorInfoDTO getVisitorInfoByAppointmentCode(@RequestPart("visitorAuthDTO") VisitorAuthDTO visitorAuthDTO);

    /**
     * 获取访客信息
     * @param visitorAuthDTO
     * @return
     */
    @PostMapping(value = "/visitor-auth/visitor-access-record")
    VisitorInfoDTO getVisitorAccessRecord(@RequestPart("visitorAuthDTO") VisitorAuthDTO visitorAuthDTO);

    /**
     * 取消授权
     * @param visitorAuthDTO
     * @return
     */
    @PostMapping(value = "/visitor-auth/cancel")
    ResultJson cancelVisitorAuth(@RequestPart("visitorAuthDTO") VisitorAuthDTO visitorAuthDTO );

    /**
     * 下发二维码
     * @param visitorAuthDTO
     * @return
     */
    @PostMapping(value = "/visitor-auth/qr-code")
    ResultJson getQrCode(@RequestPart("visitorAuthDTO") VisitorAuthDTO visitorAuthDTO  );

    /**
     * 蒙牛宁夏工厂创建访客VR人员
     * @param visitorAuthDTO
     * @return
     */
    @PostMapping(value = "/visitor-auth/vr/visitor")
    ResultJson createVrVisitor(@RequestPart("visitorAuthDTO") VisitorAuthDTO visitorAuthDTO);

    /**
     * 获取第三方门禁信息(蒙牛)
     * @param visitorAuthDTO
     * @return
     */
    @PostMapping(value = "/visitor-auth/get-open-device-info")
    ResultJson getVisitorAreaInfo(@RequestPart("visitorAuthDTO") VisitorAuthDTO visitorAuthDTO);

    /**
     * 根据OpenId获取人员门禁设备信息
     * @param visitorAuthDTO
     * @return
     */
    @PostMapping(value = "/visitor-auth/get-device-by-openid")
    ResultJson<List<Auth>> getAuthDeviceListByOpenId(@RequestPart("visitorAuthDTO") VisitorAuthDTO visitorAuthDTO);

    /**
     * 海康isc取消预约cancelVisitor
     * @param appointRecordId
     * @return
     */
    @PostMapping(value = "/visitor-auth/cancel-visitor")
    ResultJson cancelVisitor(@RequestPart("projectId") Integer projectId,@RequestPart("appointRecordId") String appointRecordId);

    /**
     * 海康isc访客签离
     * @param openId
     * @return
     */
    @PostMapping(value = "/visitor-auth/leave-visitor")
    ResultJson leaveVisitor(@RequestPart("projectId") Integer projectId,@RequestPart("openId") String openId);

    /**
     * 海康isc访客二维码获取
     * @param visitorQRCodeQuery
     * @return
     */
    @PostMapping(value = "/visitor-auth/visitor-qrcode")
    ResultJson visitorQRCode(@RequestPart("projectId") Integer projectId,@RequestPart("visitorQRCodeQuery") VisitorQRCodeQuery visitorQRCodeQuery);

    /**
     * 海康isc访客权限组
     * @param groupName
     * @return
     */
    @PostMapping(value = "/visitor-auth/pull-visitor-privilege-group")
    List<VisitorGroupListDTO> pullVisitorPrivilegeGroup(@RequestPart("projectId") Integer projectId, @RequestPart("groupName") String groupName);

}
